﻿'' GoogleCode - http://code.google.com/p/outlook-4-you/
'' GNU GPL v3 Licencing

Public Class AESAddIn
#Region "Constants"
    Private Const cb_name As String = "AESmail" ''This should be unique to your bar
#End Region

#Region "Inspector UI"
    Private WithEvents icb As Office.CommandBar
    Private WithEvents icbbAES As Office.CommandBarButton
#End Region

#Region "VSTO required"
    Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup

    End Sub
    Private Sub ThisAddIn_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown

    End Sub
#End Region

#Region "Outlook tasks"
    Private Sub objInspector_NewInspector(ByVal Inspector As Microsoft.Office.Interop.Outlook.Inspector)
        Dim item As Object = Inspector.CurrentItem

        If (TypeOf item Is Outlook.MailItem) Then
            icb = Inspector.CommandBars.Add(cb_name, Office.MsoBarPosition.msoBarTop, False, True)
            icb.Visible = True
            icb.Protection = Microsoft.Office.Core.MsoBarProtection.msoBarNoCustomize

            icbbAES = icb.Controls.Add(Office.MsoControlType.msoControlButton, , , 1, True)
            With icbbAES
                .Style = Microsoft.Office.Core.MsoButtonStyle.msoButtonIconAndCaption
                .Caption = "AES mail"
                .FaceId = 3975  '3197 file instack, 3975 linked comps, 0627 barcode, 2173 wand, 2950 smiley
                .Tag = "AESbtn"
                .Visible = True
            End With
            AddHandler icbbAES.Click, AddressOf Me.icbbAES_Click
        End If
    End Sub  '' Does something based on Inspector Type
#End Region

    Private Sub icbbAES_Click(ByVal Ctrl As Microsoft.Office.Core.CommandBarButton, ByRef CancelDefault As Boolean) Handles icbbAES.Click

    End Sub
End Class
